﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace XnaTools
{
    public abstract class BaseScene
    {
        readonly DrawingSurface _drawingSurface;
        readonly FrameworkElement _inputSurface;
        readonly MouseState _mouseState;

        protected MouseState MouseState
        {
            get { return _mouseState; }
        }

        protected FrameworkElement InputSurface
        {
            get { return _inputSurface; }
        }

        protected DrawingSurface DrawingSurface
        {
            get { return _drawingSurface; }
        }

        protected BaseScene(DrawingSurface drawingSurface, FrameworkElement inputSurface)
        {
            _drawingSurface = drawingSurface;
            _inputSurface = inputSurface;
            _mouseState = new MouseState(inputSurface);
            _drawingSurface.Loaded += new RoutedEventHandler(OnLoaded);
            _drawingSurface.SizeChanged += new SizeChangedEventHandler(OnSizeChanged);
            _drawingSurface.Draw += new EventHandler<DrawEventArgs>(OnDraw);
        }

        protected virtual void OnDraw(object sender, DrawEventArgs e)
        {
        }

        protected virtual void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {            
        }

        protected virtual void OnLoaded(object sender, RoutedEventArgs e)
        {            
        }        
    }
}
